home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / Tutorial / ARexx Tutorial / TuteRexx / DOS-DOpus11.dopus5 < prev    next >
Text File  |  1998-09-14  |  1KB  |  24 lines

  1. /*
  2.  $VER: DOS-DOpus.dopus5 1.1 (28.7.98)
  3.  Loads current shell directory into a new DOpus5 lister, selects files
  4.  according to the passed filespec.
  5.  
  6. */
  7. options results                        /* Enable results */
  8. parse arg pattern .                    /* Parse a given pattern into a variable */
  9. if ~show('P','DOPUS.1') then do        /* Check for DOPUS.1 ARexx port */
  10.   Say "DirectoryOpus is not running."  /* Warn user if DOpus not running */
  11.   Exit (5)                             /* Exit with result code = 5 (Warn) */
  12.   end                                  /* End this loop */
  13. Address 'DOPUS.1'                      /* Address DOpus */
  14. dopus front                            /* Bring DOpus to the front */
  15. dir = pragma('d')                      /* Returns current shell in 'dir' */
  16. lister new dir                         /* Open a new lister, path 'dir' */
  17. handle = result                        /* Store the handle */
  18. lister wait handle                     /* Wait for the lister to finish */
  19. if pattern ~= '' then do
  20.   command source handle select "name="pattern  /* Select the files */
  21.   lister refresh handle                /* Refresh the display */
  22.   end
  23. exit                                   /* Exit */
  24.